set memref to the member of sprite the currentSpriteNum
set castLibNum to the castLibNum of memref
set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
end if
set p_list to [#downState: [#comment: "Pict for Down:", #format: #bitmap, #default: memdefault], #background: [#comment: "Slider Background Sprite:", #format: #integer, #default: the currentSpriteNum + 1], #boundingsprite: [#comment: "Bounding Box Sprite:", #format: #integer, #default: the currentSpriteNum + 2], #Slider: [#comment: "Slider Knob Sprite:", #format: #integer, #default: the currentSpriteNum + 3]]
return p_list
end
on getBehaviorDescription
return "Pops up a slider to set the system volume." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Down Member - the picture of the button when pressed." & RETURN & "ΓÇó Slider Background Sprite - the slider background sprite." & RETURN & "ΓÇó Bounding Box Sprite - the bounding box sprite, make invisible rect." & RETURN & "ΓÇó Slider Knob Sprite - the slider knob sprite."
end
on getAssocMembers
set myPropList to [downState]
return myPropList
end
on beginSprite me
set upstate to the member of sprite the spriteNum of me
end
on mouseDown me
set the member of sprite the spriteNum of me to member downState
set soundRangeCast to the number of member the castNum of sprite boundingsprite
set soundHeight to the height of cast soundRangeCast
set the loc of sprite background to point((the left of sprite boundingsprite + the right of sprite boundingsprite) / 2, (the top of sprite boundingsprite + the bottom of sprite boundingsprite) / 2)
set the loc of sprite Slider to the loc of sprite boundingsprite
set gOutLevel to 7 - the soundLevel
set the locV of sprite Slider to (gOutLevel * (soundHeight / 7)) + the top of sprite boundingsprite
updateStage()
set the constraint of sprite Slider to boundingsprite
repeat while the stillDown
if rollOver(background) then
set the locV of sprite Slider to the mouseV
set gOutLevel to (the mouseV - the top of sprite boundingsprite + 1) / (soundHeight / 7)
updateStage()
end if
end repeat
set the member of sprite the spriteNum of me to upstate
updateStage()
if gOutLevel < 0 then
set gOutLevel to 0
end if
if gOutLevel > 7 then
set gOutLevel to 7
end if
set the soundLevel to 7 - gOutLevel
if soundBusy(2) = 0 then
beep()
end if
set the loc of sprite background to point(1000, 1000)
set the loc of sprite boundingsprite to point(1000, 1000)